1. Field of the Invention
The invention relates to a Universal Serial Bus (USB) compound device, especially regarding to a USB compound device with low production cost and unrestricted expansion, and the method for implementation thereof.
2. Description of the Related Art
Various types of communication connections and communication protocols are utilized in the connection of various devices, so that each device is able to communicate with one another. Communication connections utilize a diversity of methods to control the commands and the data flow directions. For example, in one type of communication connection, it requires a host device and a slave device. Under this system structure, the host device sends a command that allows the slave device to proceed with communication, whereas if the peripheral device does not receive the command, it is then unauthorized to proceed with communication. Therefore, under the structure, the single host device controls the commands and the data flow directions of the entire system. As for another type of system structure, there is no distinction for host and slave devices and each device of the system is able to send commands and data to one another.
During the past few years, a special interface system standard called “Universal Serial Bus” (USB) is established for communication connection. The serial interface is able to connect all kinds of peripherals to the computer system in a simple manner, thus solving the complication caused by connections of terminals with different standards between various peripherals and the computer. A USB system includes: a USB host, a USB device and USB interconnection. The USB host therein is responsible for controlling the timing and direction of data transmission on the USB. The USB device is classified into two categories, one is “hub device” that provides the USB with new connection points, and the other is “function device” that serves as the peripheral of the system, namely a mouse, a keyboard and a printer for instance. The actual connection of a USB system forms a tiered-star structure as shown in FIG. 1, where the hub is the center of each tiered-star connection.
When the USB device (a hub or a function device) is connected to USB Bus, the USB host will assign a one and only address to the device, and then the USB host communicates with the USB device according to the address; in other words, each USB device has only one address.
The USB device also includes an endpoint structure, and in the USB device, each endpoint is an independent division that acts as the data output or reception terminal during the data transmission between the USB host and the device. Each USB device may possess a set of endpoints adapted for various data transmission characteristics. The endpoints are categorized into control, bulk, interrupt, and isochronous endpoints. Except for control endpoints, which allow two-direction data transmission, the rest are further divided into input and output endpoints.
The USB device possesses a set of endpoints, not exceeding sixteen, which are used to implement device functions, and each endpoint is assigned with a one-and-only number called “endpoint number”. Therefore, the combination of device address, endpoint number and data transmission direction (output or input) enables the endpoint to acquire a unique and specific address on USB Bus.
The device drivers constructed in the host device of the system communicate with the USB devices via the USB function interface programs provided by the system so as to execute the device function. That is, the device driver and the function device are a one-to-one relationship. Each USB device needs to have a corresponding function program within the host for the purpose of executing the function provided by the device in the system. In order to provide the convenience of USB plug-and-play function, several function device drivers that are commonly used are already embedded in the operating system. Hence, when the device is connected to USB Bus, the system can find the embedded software and executes the function thereof without additional software installation, thus making the USB easier to use.
Based on practicability and production cost considerations, several USB functions are usually integrated into a USB device. For example, a keyboard and a mouse are integrated into one USB device, which is called “multi-function device”. The multi-function device is often classified into “composite device” and “compound device”.
The internal structure of a conventional composite device 20 is shown in FIG. 2. The internal structure is the same as that of a USB device on the whole, including a USB logic 201 and a function block 202. The difference between the two is that the composite device includes a plurality of endpoints 203 that represents different functions respectively. According to USB standard, a USB device may possess up to sixteen endpoints maximum. Therefore, the composite device can utilize several endpoints therein to build up a function and utilize the other endpoints therein to build up another function. For example, the composite device can build up a mouse function 204 by endpoints 0 and 1, and then create a keyboard function 205 by endpoints 0, 2, and 3. Hence, a USB device is able to possess multiple functions according to the said design.
However, the disadvantage of the above is that the composite device is considered as a USB function device by the USB host in a USB system. Consequently, the composite device is only assigned with one address by the USB host. In other words, the embedded multiple functions thereof communicate with the USB host via the same shared USB address. The said method is different from the common function devices, which each function possesses its own independent address, and can be recognized by the host so as to load the driver for the function. For this reason, it is possible that a composite device can not utilize the embedded standard driver, and shall use the driver designed for the composite device. Meanwhile, the driver designed for the hardware device needs to be installed before the connection so as to enable the USB host to send or receive data regarding to the specific endpoints of the composite device.
Furthermore, for the reason that a USB device possesses up to sixteen endpoints maximum, the number of functions that can be constructed inside a composite device is limited.
Referring to FIGS. 3a and 3b, the diagrams show a conventional compound device 30, which is another type of multi-function device. A compound device represents a function device with an embedded hub. As shown in FIG. 3a, the conventional compound device is a keyboard device in appearance. However, the interior of the keyboard compound device 30 is constructed with a keyboard function device 310 and a hub device 320 (refer to FIG. 3b). Hence, the keyboard compound device 30 is able to provide a plurality of USB connection ports 304, 305, and enables a plurality of USB devices 306, 307 to connect to USB Bus.
In the conventional compound device, although the circuits of the keyboard function device 310 and the hub device 320 can be integrated on a single chip to reduce the production cost, the said two devices are represented as independent USB devices and each includes a set of basic circuit of the USB device. That is to say, each device has a set of USB logic circuits 311 (or 321), and the function blocks 312 (or 322). On account of each function device in the compound device being an independent USB device, each function device consequently has its own independent USB address. Meanwhile, the USB host is able to load in the embedded standard drivers according to the device type thereof and eliminate the complications caused by installation of specific drivers.
However, each USB logic circuit of the USB device represents the same interface, which is used to send and receive messages and proceed with signal format translation, to the USB host; while each function block represents one embedded function of the USB device, i.e., a keyboard, a mouse or a disk. Basically, all USB logic circuits of the USB devices have similar structures.
Hence, although the embedded functions of the compound device possess the advantage of being able to make use of standard drivers as a USB device, such type of devices however hold a disadvantage of having redundant circuits. Referring to FIG. 3b, the compound device accordingly has two sets of USB logic circuits. If one more function device is embedded in the compound device, one more set of logic is then added to the compound device.
As a conclusion from the above, in spite of the simplified circuitry as an advantage for a conventional composite device, the embedded functions thereof may not be able to use the standard drivers; whereas for a conventional compound device, the implementation of the embedded functions thereof are as convenient as that of a USB device, however, such type of devices yet possess circuitry repetition and resource wastage as the disadvantage.